﻿@using Webdiyer.WebControls.Mvc;
@model PagedArticleDTO
<div class="cCenterLeft">
    @foreach (ArticleDTO article in Model.Articles)
    {
        <div class="box">
            <div class="bar">
                <span class="barTitle">
                    <a href="@Url.Action("Index", "Article", new { id = article.Id })">@article.Title</a>
                    @if (User.Identity.IsAuthenticated && !article.IsVisitorVisible)
                    {
                        @:(User Invisible)
                    }

                </span>
                <span class="barRight">
                    @if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                        <a href="@Url.Action("EditArticle", "Admin", new { id = article.Id })" title="edit">
                            <img src='@Url.Content("~/Themes/Simple/Images/edit.png")' width="18" height="18"/>
                        </a>
                    }
                 @article.CreateTime
                 </span>
            </div>
            <div class="boxCon">
                @article.ShortDesc
            </div>
            <div class="boxBottom">
                <div style="width: 40%; float: left;">
                    <span class="color999">Category:</span> <span class="category">
                        @if (article.Category != null)
                        {
                            <a href="@Url.Content("~/category/" + @article.Category.CategoryName)" class="aNor colorblue">@article.Category.CategoryName</a> 
                        }
                    </span>
                </div>
                <div style="width: 49%; float: left;">
                    <span class="color999">Tags:</span> <span class="tags">
                        @foreach (Tag tag in article.Tags)
                        {
                            <a href="@Url.Content("~/tag/" + @tag.TagName)"><span class="tagPic"></span><span
                                class="tagName">@tag.TagName</span> </a>
                        }
                    </span>
                </div>
                <div style="width: 10%; float: left; clear: right;">
                    <span class="readIt">
                    <a href="@Url.Action("index", "article", new { id = article.Id })" class="aNor colorRed">Read It!</a> 
                    </span>
                </div>
                <div style="clear:both;">
                
                </div>
            </div>
        </div>
    }
    @Html.Pager(Model.Articles, new PagerOptions
{
    PageIndexParameterName = "page",
    CurrentPagerItemWrapperFormatString = "<span class=\"cpb\">{0}</span>",
    NumericPagerItemWrapperFormatString = "<span class=\"item\">{0}</span>",
    ShowPageIndexBox = false,
    ShowMorePagerItems = true,
    ShowFirstLast = true,
    NumericPagerItemCount = 8,
    PageIndexBoxWrapperFormatString = "go to {0}",
    HorizontalAlign = "right",
    GoToPageSectionWrapperFormatString = "<span class=\"gotoPage\">{0}</span>",
    CssClass = "pages",
    SeparatorHtml = ""
})
</div>
<div class="cCenterRight">
</div>
